package com.cn.pack.controller;

import com.cn.pack.feign.GoodService;
import com.cn.pack.feign.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Autowired
    private HelloService helloService;

    @Autowired
    private GoodService goodService;

    @RequestMapping(path = "/user/query")
    public String query(@RequestParam("username") String username) {
        String hello = helloService.say(username);
        String good = goodService.say(username);
        System.out.println("hello = " + hello);
        System.out.println("good = " + good);
        return hello + " --- " + good;
    }
}
